Button specifies the picture button number (from 1 to 255) that is deleted from the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, DeletePictButton does nothing.
Button specifies the picture button number (from 1 to 255) that is affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, EnablePictButton does nothing.
The EnabledFlag indicates if the picture button is enabled or not. All three picture button types can be either enabled or disabled. When a picture button is disabled, it becomes dim and cannot be selected by the user. All picture buttons automatically become disabled when the window containing them is inactive. When the window is activated, the picture buttons assume their state as set by the NewPictButton procedure, and subsequent calls to the EnablePictButton procedure. The two constants that can be used for this flag are enabled and disabled.
CONST {Button state }
enabled =true; {button is enabled }
disabled =false; {button is disabled }
See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
Button specifies the picture button number (from 1 to 255) that is affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SelectPictButton does nothing.
The SelectedFlag indicates if the picture button is selected or not. The two constants that can be used for this flag are selected and notSelected.
CONST {Button state }
selected =true; {button is selected (checked) }
notSelected =false; {button is not selected (not checked) }
See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
function GetPictButtonMin (Button: INTEGER): INTEGER;
Button specifies the picture button number (from 1 to 255) that is queried in the current window.
GetPictButtonMin returns a picture button’s minimum value limit. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonMin will return a value of zero (0).
Button specifies the picture button number (from 1 to 255) that is affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonMin does nothing. The minimum and maximum limit cannot be changed in multistage buttons.
Minimum specifies the picture button’s new minimum value limit. The picture button’s current value and maximum limit are automatically adjusted (if necessary) to be consistent with the new minimum limit.
function GetPictButtonMax (Button: INTEGER): INTEGER;
Button specifies the picture button number (from 1 to 255) that is queried in the current window.
GetPictButtonMax returns a picture button’s maximum value limit. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonMax will return a value of zero (0).
Button specifies the picture button number (from 1 to 255) that is affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonMax does nothing. The minimum and maximum limit cannot be changed in multistage buttons
Maximum specifies the picture button’s new maximum value limit. The picture button’s current value and minimum limit are automatically adjusted (if necessary) to be consistent with the new maximum limit.
function GetPictButtonVal (Button: INTEGER): INTEGER;
Button specifies the picture button number (from 1 to 255) that is queried in the current window.
GetPictButtonVal returns a picture button’s current value. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, GetPictButtonVal will return a value of zero (0).
Button specifies the picture button number (from 1 to 255) which is to be affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonVal does nothing.
Value specifies the picture button’s new current value. In multistage buttons, the value is adjusted to fit within the button’s minimum and maximum limit. In single stage buttons, the minimum and maximum limits are automatically adjusted (if necessary) to be consistent with the new current value.
Sometimes, it is necessary to simultaneously change a button’s value and to select or deselect it, otherwise the transition from one stage to another would look jerky. An example of this is a multistage button that locks in the selected position, then lets your application determine if conditions allow the button to be deselected in the next stage (indicating acceptance of the button’s action), or deselected in the same stage (indicating rejection of the button’s action).
Button specifies the picture button number (from 1 to 255) which is to be affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonValSelect does nothing.
Value specifies the picture button’s new current value. In multistage buttons, the value is adjusted to fit within the button’s minimum and maximum limit. In single stage buttons, the minimum and maximum limits are automatically adjusted (if necessary) to be consistent with the new current value.
The SelectedFlag indicates if the picture button is selected or not. The two constants that can be used for this flag are selected and notSelected.
CONST {Button state }
selected =true; {button is selected (checked) }
notSelected =false; {button is not selected (not checked) }
Button specifies the picture button number (from 1 to 255) which is to be affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonAccel does nothing.
Rate specifies the rate at which the picture button’s value changes. The four constants that can be used for this setting are:
picbutLinear Linear: The button’s value changes when the button is
selected. After a brief pause, the value continues to
change at a slow and consistent rate.
picbutSlowAccel Slow Acceleration: The button’s value changes when the
button is selected. After a brief pause, the value
continues to change at a rate that slowly accelerates.
picbutMedAccel Medium Acceleration: The button’s value changes when
the button is selected. After a brief pause, the
value continues to change at a moderately accelerating
rate.
picbutFastAccel Fast Acceleration: The button’s value changes when the
button is selected. After a brief pause, the value
continues to change at a rate that rapidly
accelerates.
The affected picture button must be created with the “automatic value change” and “repeating events” options both turned on for this routine to have any effect. Using SetPictButtonAccel overrides the settings established by the SetPictButtonSpeed procedure.
CONST {Value change rates: }
picbutLinear = 0; {Linear (does not accelerate) }
picbutSlowAccel = 1; {Slow acceleration }
picbutMedAccel = 2; {Medium acceleration }
picbutFastAccel = 3; {Fast acceleration }
See the NewPictButton procedure for additional information pertaining to the picture button’s automatic value change rate. Also see the SetPictButtonSpeed procedure for another method of setting the button’s speed.
Button specifies the picture button number (from 1 to 255) which is to be affected in the current window. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, SetPictButtonSpeed does nothing.
Rate specifies the constant speed at which the picture button’s value changes. The rate is expressed as an amount that is incremented per second (i.e., “30” means change the button’s value by 30 for each second it is held down).
The picture button’s value will change at the specified speed as soon as the user presses down on the button (there is no pause before the event starts repeating.) The affected picture button must be created with the “automatic value change” and “repeating events” options both turned on for this routine to have any effect. Using SetPictButtonSpeed overrides the settings established by the SetPictButtonAccel procedure.
See the SetPictButtonAccel procedure for another method of setting the button’s value change rate.
function PictButtonIsEnabled (Button: INTEGER): BOOLEAN;
Button specifies the picture button number (from 1 to 255) which is queried in the current window.
The function’s value returns true if the picture button is enabled, and false if the picture button is disabled. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, PictButtonIsEnabled returns false.
CONST {Button state }
enabled =true; {button is enabled }
disabled =false; {button is disabled }
See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
Note: PictButtonIsEnabled returns the picture button’s state as though
the picture button’s window is active. This is the case even when
the window is deactivated and all the picture buttons appear
function PictButtonIsSelected (Button: INTEGER): BOOLEAN;
Button specifies the picture button number (from 1 to 255) that is queried in the current window.
The function’s value returns true if the picture button is selected, and false if the picture button is not selected. If the current window doesn’t belong to your application, or if no windows are open, or if the picture button does not exist in the current window, PictButtonIsSelected returns false.
CONST {Button state }
selected =true; {button is selected (checked) }
notSelected =false; {button is not selected (not checked) }
See the NewPictButton procedure for additional information pertaining to the picture button’s enabling, disabling, and selection.
Flash a picture button as though it was clicked by the user.
pascal void FlashPictButton(short Button);
procedure FlashPictButton(Button: INTEGER);
Button specifies the picture button number (from 1 to 255) that is affected in the active window. If the active window doesn’t belong to your application, or if no windows are open, FlashPictButton does nothing.
FlashPictButton can be used in some specific instances. Advanced programmers may decide to display a modal window when the Macintosh is busy with a lengthy process. If a picture button (such as “Cancel”) on this window is equivalent to typing Command-., the picture button should be flashed when a Command-. is reported by PollSystem. This makes the user feel that the key triggered the picture button. Another example is double-clicking in a list box; this action can be interpreted as “select line and OK” in which case the OK picture button should be flashed.